package com.vne.skyemart.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.vne.skyemart.dao.ImageDao;
import com.vne.skyemart.model.Image;
import com.vne.skyemart.service.ImageService;

@Service("imageService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class ImageServiceImpl implements ImageService{
	@Autowired
	private ImageDao imageDao;

	public ImageDao getImageDao() {
		return imageDao;
	}

	public void setImageDao(ImageDao imageDao) {
		this.imageDao = imageDao;
	}
	public ImageServiceImpl() {}
	@Transactional(propagation = Propagation.SUPPORTS,readOnly = false)
	@Override
	public void addImage(Image image) {
		imageDao.save(image);
	}

	@Override
	public List<Image> listImage() {
		return imageDao.findAll();
	}
	
}
